<!DOCTYPE html>
<html lang="zh">
<head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Hello, World</title>
    <style type="text/css">
        html{height:100%}
        body{height:100%;margin:0;padding:0}
        #container{height:100%}
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak={你的秘钥}"></script>
</head>

<body>
<div id="container"></div>
<script type="text/javascript">
    // 创建地图实例
    const map = new BMap.Map("container");
    // 创建点坐标
    const point = new BMap.Point(116.404, 39.915);
    // 初始化地图，设置中心点坐标和地图级别
    map.centerAndZoom(point, 3);
    const longitudeAndLatitudeLine = [[11.201,25.910],[116.405,39.920],[120.405,2.920]];
    const bMapLine = [];
    for (let i in longitudeAndLatitudeLine) {
        bMapLine.push(new BMap.Point(longitudeAndLatitudeLine[i][0], longitudeAndLatitudeLine[i][1]))
    }
    var polyline = new BMap.Polyline(
        bMapLine,
        {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}
    );
    map.addOverlay(polyline);
</script>
</body>
</html>